-- GENERATED SPELL FOR [Twilight Thug] --


function spell0_2339(pUnit, Event) --@Battle Shout,Self--
pUnit:FullCastSpellOnTarget(5242,pUnit)
pUnit:RegisterEvent('Sorts_2339', 690, 1)
end

function spell1_2339(pUnit, Event) --@Battle Stance,Self--
pUnit:FullCastSpellOnTarget(7165,pUnit)
pUnit:RegisterEvent('Sorts_2339', 611, 1)
end

function spell2_2339(pUnit, Event) --@Disarm,n/a--
pUnit:FullCastSpellOnTarget(6713,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2339', 5318, 1)
end

function Sorts_2339(pUnit, Event)
local choix_sorts_2339 = math.random(0, 2)
if choix_sorts_2339 == 0 then
pUnit:RegisterEvent('spell0_2339', 1, 1)
end
if choix_sorts_2339 == 1 then
pUnit:RegisterEvent('spell1_2339', 1, 1)
end
if choix_sorts_2339 == 2 then
pUnit:RegisterEvent('spell2_2339', 1, 1)
end
end

function mob2339_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2339', math.random(1500, 3000), 1)
end

function mob2339_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2339_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2339_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2339, 1, 'mob2339_Action')
RegisterUnitEvent(2339, 2, 'mob2339_Leave')
RegisterUnitEvent(2339, 3, 'mob2339_Kill')
RegisterUnitEvent(2339, 4, 'mob2339_Die')
